import { RequestResponse } from '@/types/request'
// import { dataInterface } from '../api/api/index'

const http = uni.$u.http

export function get<T, N = undefined>(url: string, data?: Record<string, unknown>) {
  return http.get(url, data) as Promise<N extends null ? T : RequestResponse<T>>
}

export function post<T, N = undefined>(url: string, data?: Record<string, unknown>) {
  return http.post(url, data) as Promise<N extends null ? T : RequestResponse<T>>
}
